﻿using HomagChina.CCT.Router;
using HomagGroup.Base.UI;

namespace HomagChina.CCT.ViewModels
{
    public class SaveProjectDialogViewModel : NotifyPropertyChangedBase
    {
        public RelayCommand Save { get; }

        public RelayCommand Cancel { get; }

        private string _projectName;

        public string ProjectName
        {
            get => _projectName;
            set { _projectName = value; OnPropertyChanged(); }
        }

        public string ProjectDescription
        {
            get => _projectDescription;
            set { _projectDescription = value; OnPropertyChanged(); }
        }

        private string _projectDescription;

        public SaveProjectDialogViewModel()
        {
            Save = new RelayCommand(() => { ((IntelligencePlatformViewModel)NavigateServices.Instance.CurrentRouteInfo.userControl.DataContext).ExportToCSV(ProjectName, ProjectDescription); });
            Cancel = new RelayCommand(((IntelligencePlatformViewModel)NavigateServices.Instance.CurrentRouteInfo.userControl.DataContext).HandleCloseDialog);
        }
    }
}